<nz-modal
  [(nzVisible)]="showEdit"
  nzTitle="编辑"
  [nzWidth]="720"
  [nzContent]="modalContent"
  [nzFooter]="modalFooter"
  (nzOnCancel)="close()"
>
  <ng-template #modalContent>
    <form nz-form [formGroup]="validateForm">
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>标题</nz-form-label>
        <nz-form-control [nzSpan]="16" nzErrorTip="请输入标题">
          <input type="text" nz-input formControlName="title" />
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>内容</nz-form-label>
        <nz-form-control [nzSpan]="16" nzErrorTip="请输入内容">
          <textarea rows="5" nz-input formControlName="content"></textarea>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>创建人</nz-form-label>
        <nz-form-control [nzSpan]="16" nzErrorTip="请选择创建人">
          <app-drop-select
            [formControl]="validateForm.get('createUser.id')"
          ></app-drop-select>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4">图片</nz-form-label>
        <nz-form-control [nzSpan]="16">
          <nz-upload
            nzAccept="image/*"
            [(nzFileList)]="fileList"
            [nzBeforeUpload]="beforeUpload"
          >
            <button nz-button nzType="primary">上传图片</button>
          </nz-upload>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4">是否已读</nz-form-label>
        <nz-form-control [nzSpan]="16">
          <nz-switch formControlName="isRead"></nz-switch>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-template>
  <ng-template #modalFooter>
    <button nz-button (click)="close()">取消</button>
    <button
      nz-button
      nzType="primary"
      [disabled]="validateForm.invalid"
      [nzLoading]="hasClicked"
      (click)="submit()"
    >
      <span>保存</span>
    </button>
  </ng-template>
</nz-modal>
